import request from "@/router/axios";

export const getList = (current, size, params) => {
  return request({
    url: "/api/blade-system/tenant/list",
    method: "get",
    params: {
      ...params,
      current,
      size,
    },
  });
};

// export const getList = id => {
//   return request({
//     url: "/api/blade-system/tenant/selectByCode",
//     method: "get",
//     params: {
//       tenantId: id
//     }
//   });
// };
export const remove = (ids) => {
  return request({
    url: "/api/blade-system/tenant/remove",
    method: "post",
    params: {
      ids,
    },
  });
};

export const add = (row) => {
  return request({
    url: "/api/blade-system/tenant/submit",
    method: "post",
    data: row,
  });
};

export const update = (row) => {
  return request({
    url: "/api/blade-system/tenant/submit",
    method: "post",
    data: row,
  });
};

export const info = (domain) => {
  return request({
    url: "/api/blade-system/tenant/info",
    method: "get",
    params: {
      domain,
    },
  });
};

export const getRegionType = (domain) => {
  return request({
    url: "/api/blade-system/dict/dictionary?code=region_scope",
    method: "get",
    params: {
      domain,
    },
  });
};

export const getTenantInfo = (tenantId) => {
  return request({
    url: "/api/blade-system/tenant/detail",
    method: "get",
    params: {
      tenantId,
    },
  });
};

export const getSchoolList = (tenantId) => {
  return request({
    url: "/api/blade-system/tenant/selectBySchoolType",
    method: "get",
    params: {
      tenantId,
      schoolType: '1,2,3,4,5'
    }
  })
}

export const getSchooltype = () => {
  return request({
    url: '/api/blade-system/dict/dictionary?code=schoolType',
    method: "get",
  })
}
